//
//  SearchViewController.m
//  LimitFree
//
//  Created by qianfeng on 15/8/31.
//  Copyright (c) 2015年 Hailong.wang. All rights reserved.
//

#import "SearchViewController.h"

@interface SearchViewController ()

@end

@implementation SearchViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    //父类是 ApplistViewcontroller
    //搜索界面  不带  搜索条
    self.tableView.tableHeaderView=nil;
    
    self.navigationItem.leftBarButtonItem=nil
    ;
    self.navigationItem.rightBarButtonItem=nil;
    
    [self addTitleViewWithTitle:@"搜索结果"];
    
    //把 tabBar隐藏了 那么tableView的高 改变
    CGRect frame = self.tableView.frame;
    frame.size.height += 49;
    self.tableView.frame = frame;
    
    
    // Do any additional setup after loading the view.
}
//标题视图
- (void)addTitleViewWithTitle:(NSString *)title {
   // UILabel *label = [MyControl creatLabelWithFrame:CGRectMake(0, 0, 200, 30) text:title];
    UILabel *label=[Factory createLabelWithTitle:title frame:CGRectMake(0, 0, 200, 30)];
    label.textAlignment = NSTextAlignmentCenter;
    //字体颜色 和 大小 一般美工 会告诉 程序员
    label.textColor = [UIColor colorWithRed:30/255.f green:160/255.f blue:230/255.f alpha:1];
    label.font = [UIFont fontWithName:@"Arial Rounded MT Bold" size:22];
    self.navigationItem.titleView = label;
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
#pragma mark - 重写
-(void)firstDownload{
    self.page = 1;
    //搜索接口
    NSString *url = [NSString stringWithFormat:self.categoryUrl,self.page,self.searchKeyword];
    //有可能有 汉字  合法转换
    url = [url stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
    [self refreshView];
}
#pragma mark -
/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
